#include<stdio.h>

long long factorial(int n);

int main(void) {
    int n;
    scanf("%d", &n);
    printf("%lld\n", factorial(n));
    return 0;
}

long long factorial(int n) {
    if (n == 0 || n == 1) {
        return 1;
    } else {
        return n * factorial(n - 1);
    }
}
